/*
 * @Description:
 * @Autor: lcz
 * @Date: 2022-08-08 15:25:54
 * @LastEditors: lcz
 * @LastEditTime: 2022-08-17 10:24:27
 */
import { useEffect, useState } from 'react'
//内置组件尺寸是否有变更的库
import ResizeObserver from 'rc-resize-observer'
import { omit } from '@webchuanzhou96/lcz-utils'
import { regFrom } from '../../utils/regForm'
const Hooks = () => {
  const [user, setUser] = useState({
    name: 'lcz',
    age: '18',
    work: 'it',
    home: 'hangzhou',
  })
  useEffect(() => {
    let filterUser = omit(user, ['home', 'work'])
    console.log(filterUser, 'text:filterUser')
  }, [])
  useEffect(()=>{
    const rules = {
      phone: [
        {
          require: true,
          errorMsg: '请输入账号',
        },
        {
          reg: /^1[3456789]\d{9}$/,
          errorMsg: '手机号码不合法',
        },
      ],
      password: {
        require: true,
        errorMsg: '请输入密码',
      },
    }
    let form = {
      phone: '',
      password: '',
    }
    console.log(regFrom(form,rules),322111)
    
  },[])
  return (
    <ResizeObserver
      onResize={(pop1, pop2) => {
        console.log(pop1, pop2, 'resized!')
      }}
    >
      <textarea />
    </ResizeObserver>
  )
}
export default Hooks
